﻿using System;

namespace PS.WssSync.Utils
{
    internal static class ConsoleHelper
    {
        public static void WriteInvalidArguments()
        {
            const string helpHint = @"Usage:

WssSync -commit | -update | -checkout [-url=<siteUrl>] [-dir=<local directory>] [-username=<user name>] [-password=<password>] [-overwrite]

    -commit         : upload files from the local directory to the server.
    -update         : download file updates from the server to the local folder.
    -checkout       : download all files from the server to the local folder.
    -url            : site url. SiteLocation from WssSync.options file is used by default.
    -dir            : optional local directory. Current directory is used if not specified.
    -overwrite      : actually overwrite files.
    -username       : optional user name. Used along with password parameter. Optionally with domain name.
    -password       : optional password.";
            Console.WriteLine(helpHint);
        }

        public static void WriteFileAction(FileAction action, string friendlyName)
        {
            Console.WriteLine(string.Format("{0}: {1}", action == FileAction.Skipped ? "Identical" : action.ToString(), friendlyName));
        }

        public static void WriteError(string message, string friendlyName)
        {
            Console.WriteLine(string.Format("error for file {0}: {1}", friendlyName, message));
        }

        public static void WriteError(string message)
        {
            Console.WriteLine("error: " + message);
        }
    }
}